import Vue from 'vue'
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import App from './App.vue'
import top from './components/top.vue'
import booksView from './components/booksView.vue'
import book from './components/book.vue'
import bookrack from './components/bookrack.vue'
import detail from './components/detail.vue'
import detail1 from './components/detail1.vue'
import my from './components/my.vue'
import my_1 from './components/my_1.vue'
import my_2 from './components/my_2.vue'
import my_3 from './components/my_3.vue'
import index1 from './components/login/index1.vue'
import registr from './components/login/registr.vue'
import login from './components/login/login.vue'
import VueRouter from "vue-router"
import store from './vuex/store'
//开启debug模式
Vue.config.debug = true;
Vue.use(VueRouter);
Vue.use(MintUI)
import axios from 'axios'
Vue.prototype.$http = axios;


// 创建一个路由器实例并且配置路由规则
const router = new VueRouter({
  mode: 'history',
  base: __dirname,
  routes: [
      { path: '/', component:top },
      { path: '/top', component: top },
      { path: '/book', component: book },
      { path:'/bookrack',component: bookrack },
      { path: '/booksView', component:booksView },
      { path: '/detail', component: detail },
      { path: '/detail1', component: detail1 },
      { path:'/login/index1',component:index1,children:[
          { path: '/login/registr', component:registr},
          { path: '/login/login', component:login },
      ]},
      { path: '/login/login', component:login },
      { path: '/my', component:my ,
          children:[{path:'my_1',component:my_1},
              {path:'my_2',component:my_2},
              {path:'my_3',component:my_3},

          ]}

  ]
})

// 路由器会创建一个 App 实例，并且挂载到选择符 #app 匹配的元素上。
const app = new Vue({
      router: router,
      store,
      render: h => h(App)
}).$mount('#app')

